import request from '@/utils/request'
// 列表
export function listFastDetectionTask(query) {
    return request({
        url: '/forest/fastDetectionTask/list',
        method: 'get',
        params: query
    })
}
// 快检检测依据
export function listFastDetectionAccording(query) {
    return request({
        url: '/system/dict/data/type/fast_detection_according',
        method: 'get',
        params: query
    })
}
// 快检检测类别
export function listFastDetectionType(query) {
    return request({
        url: '/system/dict/data/type/fast_detection_type',
        method: 'get',
        params: query
    })
}
// 查询检测机构列表
export function listInstitution(query) {
    return request({
        url: '/forest/institution/list',
        method: 'get',
        params: query
    })
}
// 园区列表
export function listInspector(query) {
    return request({
        url: '/forest/orchard/list',
        method: 'get',
        params: query
    })
}
// 快速检测项目 - 酶抑制率法
export function listFastDetectionTypeMei(query) {
    return request({
        url: '/system/dict/data/type/fast_detection_type_mei',
        method: 'get',
        params: query
    })
}
// 快速检测项目 - 胶体金免疫层析法
export function listFastDetectionTypeJiao(query) {
    return request({
        url: '/system/dict/data/type/fast_detection_type_jiao',
        method: 'get',
        params: query
    })
}
// 树种列表
export function listSpecies(query) {
    return request({
        url: '/forest/species/list',
        method: 'get',
        params: query
    })
}
// 新增快速检测任务
export function addFastDetectionTask(data) {
    return request({
        url: '/forest/fastDetectionTask',
        method: 'post',
        data: data
    })
}
// 详情
export function getFastDetectionTask(id) {
    return request({
        url: '/forest/fastDetectionTask' + id,
        method: 'get'
    })
}
// 启动任务
export function startTask(id) {
    return request({
        url: '/forest/fastDetectionTask/start/' + id,
        method: 'get'
    })
}
// 获取快检员列表
export function getFastDetectionTaskUsers(id) {
    return request({
        url: '/system/user/listByDept/' + id,
        method: 'GET',
    })
}

// 下发快检任务
export function fastDetectionTaskSave(taskId, userIds) {
    return request({
        url: '/activiti/task/fastDetectionTaskSave/' + taskId,
        method: 'POST',
        data: [{
            controlId: 'quickInspector',
            controlValue: userIds.join(',')
        }]
    })
}
// 批准快检任务
export function fastDetectionTaskSave2(taskId, userIds) {
    return request({
        url: '/activiti/task/fastDetectionTaskSave/' + taskId,
        method: 'POST',
        data: [{
            controlId: 'supervision',
            controlValue: userIds.join(',')
        }]
    })
}
// 批量更新抽样信息
export function batchUpdateSampleInfo(data) {
    return request({
        url: '/forest/fastSampleInfo/batchUpdateList',
        method: 'PUT',
        data: data
    })
}
// 快检人员列表
export function inspector(data) {
    return request({
        url: '/forest/inspector/list',
        method: 'get',
        data: data
    })
}
// 添加快检人员
export function addInspector(data) {
    return request({
        url: '/forest/inspector',
        method: 'post',
        data: data
    })
}
// 删除快检人员
export function deleteInspector(id) {
    return request({
        url: '/forest/inspector/' + id,
        method: 'delete'
    })
}
// 编辑快检人员
export function editInspector(data) {
    return request({
        url: '/forest/inspector',
        method: 'put',
        data: data
    })
}
